<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>住院通知单</title>
	<link rel="stylesheet" type="text/css" href="<c:url value="/css/themes/default/easyui.css"/>">
	<link rel="stylesheet" type="text/css" href="<c:url value="/css/themes/icon.css"/>">
	
	<script type="text/javascript" src="<c:url value="/js/jquery.min.js"/>"></script>
	<script type="text/javascript" src="<c:url value="/js/jquery.easyui.min.js"/>"></script>
	<script type="text/javascript" src="<c:url value="/js/easyui-lang-zh_CN.js"/>"></script>
</head>
<body>
	<script type="text/javascript">
		$(function(){
			
			//显示全部住院通知单
			$("#xssy").linkbutton({onClick:function(){
				$("#tb-zytz").datagrid({
    			url: 'zytzall', 
    			method: 'get'
    			});
			}});
			
			//根据医疗卡搜索
			$('#his-search').searchbox({
			    searcher:function(value,name){
			    	$("#tb-zytz").datagrid({
			    		url: 'cxylkno', 
			    		method: 'post', 
			    		queryParams: {
			    			ylkNo: value
			    		}});
			    }
			});
		
			
			$("#rydj").linkbutton({onClick:function(){
					var rows = $("#tb-zytz").datagrid("getSelections");
					if(rows.length == 1){
						$("#his_zy").window("open");
						var ylkNo = rows[0].ylkNo;
						$.getJSON("tomm", {"ylkNo": ylkNo}, function(data){
							$("#form-hiszy").form("load", data);
						});
					}
					else{
						$.messager.alert("提示", "只能选择一条记录，您目前选择了" + rows.length + "条!");
					}
					
					$('#form-hiszy').form("clear");
					
				}});
			
			$("#zytzbnt1").linkbutton({onClick: function(){
				$('#form-hiszy').form('submit', {
					url:'bcjbxx',
				    onSubmit: function(){
				    	
				    },
				    success:function(data){
				    	var json = eval("(" + data + ")");
						$.messager.alert("提示", json.reason);
						//关闭窗口
						$('#his_zy').window('close');
						//重新加载数据
						$("#tb-zytz").datagrid("reload");
						$(this).form("clear");
				    }
				});}});
			
		});
	</script>


	<table id="tb-zytz" class="easyui-datagrid" 
		data-options="url:'zytzall',
			fitColumns:true,fit:true,
			pagination: true,
			pageSize: 5,
			pageList: [5, 10, 15, 20],
			rownumbers: true,
			singleSelect:true,
			align:'center',
			toolbar: '#ztgjl',
			"  >
		<thead>
			<tr>
				<th data-options="field:'zyNo',width:'3%', align:'center',checkbox: true">住院号</th>
				<th data-options="field:'ylkNo',align:'center',width:'25%'">医疗卡号</th>
				<th data-options="field:'brxm',align:'center',width:'25%'">姓名</th>
				<th data-options="field:'ysmc',align:'center',width:'25%'">门诊医生</th>
				<th data-options="field:'ksmc',align:'center',width:'23%'">科室</th>
			</tr>
		</thead>
	</table>
	<!--工具栏-->
	<div id="ztgjl">
		<a  id="xssy" class="easyui-linkbutton" data-options="iconCls:'icon-xsqb',plain:true">显示所有待入院</a>
		<a  id="rydj" class="easyui-linkbutton" data-options="iconCls:'icon-rydj',plain:true">办理入院登记</a>
		<input id="his-search" class="easyui-searchbox" data-options="width:220,prompt: '请输入诊疗卡号'">
	</div>
	<!--入院登记表-->
	<div id="his_zy" class="easyui-window" title="入院登记"  data-options="collapsible:false,minimizable:false,maximizable:false,modal:true,iconCls:'icon-rydj',closed: true" 
				style="width:400px;height:410px;padding:5px;">
			<div  style="padding:5px;border:0px ;height:318px;">
				<form id="form-hiszy" action="" method="post" >
					<div class="item"><input name="brName"  class="easyui-textbox" data-options="label: '病人姓名：', width: 200"></div>
					<div class="item"><input name="brAge"  class="easyui-textbox" data-options="label: '年龄：', width: 200"></div>
					<div class="item"><input name="brSex"   class="easyui-textbox" data-options="label: '性别：', width: 200"></div>
					<div class="item"><input name="ygName"   id="ys" class="easyui-textbox " data-options="label: '门诊医生：', width: 200"></div>
					<div class="item"><input name="khDepartment" class="easyui-textbox " data-options="label: '科室：', width: 250"></div>
					<div class="item"><input name="ksNo"   class="easyui-textbox " data-options="label: '科室号：', width: 250"></div>
					<div class="item"><input name="brlxfs"   class="easyui-textbox" data-options="label: '联系方式：', width: 200"></div>
					<div class="item"><input name="brAddress"   class="easyui-textbox" data-options="label: '家庭住址：', width: 230"></div>
					<div class="item"><input name="brIdcard"   class="easyui-textbox" data-options="label: '身份证号：', width: 230"></div>
					<div class="item"><input name="ylkNo" class="easyui-textbox" data-options="label: '医疗卡号', width: 200"></div>
					<div class="item"><input name="brruqk" class="easyui-textbox" data-options="label: '入院情况：', width: 200"></div>
					<div class="item"><input name="ryri" class="easyui-datebox" data-options="label: '入院时间：', width: 200"></div>
				</form>
			</div>
			<div data-options="region:'south',border:false" style="text-align:right;padding:5px 0 0;">
				<a id="zytzbnt1" class="easyui-linkbutton" data-options="iconCls:'icon-ok', plain:true" >确定</a>&nbsp;&nbsp;
				<a id="zytzbnt2" class="easyui-linkbutton" data-options="iconCls:'icon-cancel', plain:true" href="javascript:$('#his_zy').window('close');" onclick="">取消</a>
			</div>
		
	</div>
	
</body>
</html>